<template>
    <div class="home">

        项目名：<input type="file" @change="set"><br>
        <input type="submit" @click="submit">

    </div>

</template>

<script>
    import axios from 'axios'
    // @ is an alias to /src
    export default {
        name: 'AddForm',
        data() {
            return {
                file: {},
            }
        },
        methods: {
            submit() {
                const form = new FormData();
                form.append('file', this.file)
                axios({
                    url: 'http://128.hktqa.cn:3001/api/pushDist',
                    method: 'post',
                    headers: {
                        'Content-Type':'multipart/form-data'
                    },
                    data: form
                })
            },
            set(e){
                this.file = e.target.files[0]
            }
        }
    }
</script>
